slack postMessage API のshow more条件
Slack の postMessage で、長文が show more / see more で折りたたまれたり、折りたたまれなかったりする条件を調べてみた
https://api.slack.com/methods/chat.postMessage
分かった事
文字のある連続した5行があると、 show more で折りたたまれる
空行(改行だけの行)があると、この条件に合わず、折りたたまれず、チャットが長文で埋め尽くされる
先頭に空行があると、 show more が出るまで多くの行数が表示される
強制的に5行でshow moreを出すには
最初に空行がある場合は削除する
最初の5行に空行がある場合、空行に空白を1文字いれる
block kitの場合
条件が増えてました
https://api.slack.com/messaging/composing/layouts#when-to-use-attachments
Any content displayed within attachments may be wrapped, truncated, or hidden behind a "show more" style option by Slack clients. This isn't the case with the top-level blocks field.
blockのトップレベルはshow moreされない